<template>
  <div>
    <div>
      <el-input v-model="input" style="width:70%" placeholder="请输入内容" />
      <h5>{{ input }}</h5>
      <el-button type="primary" style="width:20%" @click="testget()">get</el-button>
      <el-button type="primary" style="width:20%" @click="testpost()">post</el-button>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      input: ' '
    }
  },
  methods: {
    testget() {
      this.$http
        .get('/extraction', {
          params: {
            number: this.input
          }
        })
        .then(res => {
          console.log(res)
          console.log(this.input)
        })
        .catch(err => {
          console.log(err)
          console.log(this.input)
        })
    },
    testpost() {
      this.$http
        .post('/extraction', this.input)
        .then(res => {
          console.log(res)
          console.log(this.input)
        })
        .catch(err => {
          console.log(err)
          console.log(this.input)
        })
    }
  }
}
</script>

<style lang="scss" scoped>

</style>
